Column name of Layout DXL

Hi,

When one create a Layout DXL, there is a variable that points to the current object (obj).
Is there a way to retrieve the name of the column from within its DXL code ? In other ways, is there a variable that points to the column ?

(The value I want to compute / display depends on the current object as well as the column name.)

Thanks for your answers.

Alain
adevicq - Fri Apr 09 12:03:10 EDT 2010

Re: Column name of Layout DXL
llandale - Fri Apr 09 13:46:15 EDT 2010

HA! Didn't know this a minute ago, but this seems to work as a LAYOUT:

Column c = currentColumn()
if (null c)
     display "null c"
else display (title(c))

 


Put that in, modify the column title, and see what happens.

Probably only works for a layout.

 

 

 

  • Louie

 

 

Re: Column name of Layout DXL
llandale - Fri Apr 09 13:50:05 EDT 2010

llandale - Fri Apr 09 13:46:15 EDT 2010

HA! Didn't know this a minute ago, but this seems to work as a LAYOUT:

Column c = currentColumn()
if (null c)
     display "null c"
else display (title(c))

 


Put that in, modify the column title, and see what happens.

Probably only works for a layout.

 

 

 

  • Louie

 

 

currentColumn() is new to DOORS v9.

Re: Column name of Layout DXL
adevicq - Sun Apr 11 16:55:13 EDT 2010

Thanks Louie, but forgot to mention I'm in 8.3...
Nothing to do ? Sure ???

Alain

Re: Column name of Layout DXL
Peter_Albert - Mon Apr 12 03:53:02 EDT 2010

adevicq - Sun Apr 11 16:55:13 EDT 2010
Thanks Louie, but forgot to mention I'm in 8.3...
Nothing to do ? Sure ???

Alain

In 8.3, you can use the attached DXL to get the current layout DXL column.

// GetColumnExample
#include <../layout/include/getCurrentColumn.inc>
Column col = getCurrentColumn("GetColumnExample")
if (!null col){display title(c) ""}


Regards,

Peter


Attachments

attachment_14455379_getCurrentColumn.inc

Re: Column name of Layout DXL
adevicq - Mon Apr 12 06:21:54 EDT 2010

Peter_Albert - Mon Apr 12 03:53:02 EDT 2010

In 8.3, you can use the attached DXL to get the current layout DXL column.

// GetColumnExample
#include <../layout/include/getCurrentColumn.inc>
Column col = getCurrentColumn("GetColumnExample")
if (!null col){display title(c) ""}


Regards,

Peter

Peter,
Thanks for your help but it does not really fit my need. I'm lookking for a function without any parameters: I shouldn't have to identify the column I'm looking for. DOORS obviously knows the "current" column without requiring my help !

Thanks again.

Alain.

Re: Column name of Layout DXL
Peter_Albert - Mon Apr 12 06:27:37 EDT 2010

adevicq - Mon Apr 12 06:21:54 EDT 2010
Peter,
Thanks for your help but it does not really fit my need. I'm lookking for a function without any parameters: I shouldn't have to identify the column I'm looking for. DOORS obviously knows the "current" column without requiring my help !

Thanks again.

Alain.

Alain,

I should have been more specific. What you want is not possible in 8.3 "out of the box", only with the new perm indicated in the other post. The solution I proposed is a workaround, and admittedly not a nice one, but at least it provides you a mean to get a handle to the current column.

Regards,

Peter

Re: Column name of Layout DXL
adevicq - Tue Apr 13 03:43:49 EDT 2010

Peter_Albert - Mon Apr 12 06:27:37 EDT 2010
Alain,

I should have been more specific. What you want is not possible in 8.3 "out of the box", only with the new perm indicated in the other post. The solution I proposed is a workaround, and admittedly not a nice one, but at least it provides you a mean to get a handle to the current column.

Regards,

Peter

Peter,

Just after my answer to your post I started to think your solution was much smarter than I thought at first sight (!)
I'm definitely going to use it.

Thanks for your contribution.

Alain

Re: Column name of Layout DXL
Mathias Mamsch - Tue Apr 13 09:28:17 EDT 2010

adevicq - Tue Apr 13 03:43:49 EDT 2010
Peter,

Just after my answer to your post I started to think your solution was much smarter than I thought at first sight (!)
I'm definitely going to use it.

Thanks for your contribution.

Alain

Peter, what a great solution using the DXL code, to identify itself :-)

Making this a little bit shorter I get the code below (assuming that the unique identifier is not accidentally happening to be another column (use a GUID or something)
 

int i = 0
for (i=0; i < 50; i++) { int x,y; string s = dxl column i;  if (!null s) if (findPlainText (s, "#SOME-UNIQUE-IDENTIFIER#",x,y,false)) break}
 
display "I am column " i " and have the title " (title column i) ""

 


Regards, Mathias

 

Re: Column name of Layout DXL
Peter_Albert - Wed Apr 14 04:05:28 EDT 2010

Mathias Mamsch - Tue Apr 13 09:28:17 EDT 2010

Peter, what a great solution using the DXL code, to identify itself :-)

Making this a little bit shorter I get the code below (assuming that the unique identifier is not accidentally happening to be another column (use a GUID or something)
 

int i = 0
for (i=0; i < 50; i++) { int x,y; string s = dxl column i;  if (!null s) if (findPlainText (s, "#SOME-UNIQUE-IDENTIFIER#",x,y,false)) break}
 
display "I am column " i " and have the title " (title column i) ""

 


Regards, Mathias

 

Mathias, that's a nice improvent, by which the identifier only has to be put in place once, not twice as in my solution.